package com.adou.d10;

import java.util.Comparator;

/**
 * 构造比较器
 */
public class ComparatorTest {
    public static Comparator<String> getComparator(){

//        return new Comparator<String>() {
//            @Override
//            public int compare(String o1, String o2) {
//                return o1.length() - o2.length();
//            }
//        };

        return (o1, o2) -> o1.length() - o2.length();
    }



}
